package list.com.Test1;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class JDKDateDemo {
    public static void main(String[] args) {
        LocalDateTime l = LocalDateTime.of(2021, 11, 17, 14, 12);
        //转换成一个LocalDate对象
        LocalDate localDate = l.toLocalDate();
        System.out.println(localDate);

        //转换成一个LocalTime对象
        LocalDateTime now = LocalDateTime.now();
        LocalTime localTime = now.toLocalTime();
        System.out.println(localTime);
    }
}
